<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>添加</title>
</head>
<body>
    <div>
        <div >
            <h1 th:if="${leaverecords.id==null}">添加请假记录</h1>
            <h1 th:unless="${leaverecords.id==null}">修改请假记录</h1>
        </div>
        <form action="/leaverecords/save" th:action="@{/leaverecords/save}" method="post">
            <input th:value="${leaverecords.id}" name="id"  type="hidden" />
            <table>
                <tr>
                    <td>姓名：</td>
                    <td><input type="text" name="name" th:value="${leaverecords.name}"></td>
                </tr>
                <tr>
                    <td>请假时间：</td>
                    <td><input type="text" name="leaveTime" th:value="${#dates.format(leaverecords.leaveTime,'yyyy-MM-dd')}">格式要求：yyyy-mm-dd</td>
                </tr>
                <tr>
                    <td>请假原因：</td>
                    <td><textarea cols="30" rows="5" name="reason" th:field="${leaverecords.reason}"></textarea></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input type="submit" value="提交">&nbsp;&nbsp;<input type="reset" value="重置">&nbsp;&nbsp;<a th:href="@{/leaverecords/page}"><input type="button" value="返回"></a></td>
                </tr>
            </table>
        </form>
    </div>
</body>
</html>